<?php
/**
 * @version 0.8.3 2010-10-07
 * @package Joomla
 * @subpackage LeagueResults
 * @copyright (C)  2008, 2009, 2010 Henryk Drozd
 * @license GNU/GPL, see LICENSE.php
 * LeagueResults is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License 2
 * as published by the Free Software Foundation.

 * LeagueResults is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');
jimport('joomla.html.pane');

require_once (JPATH_COMPONENT_ADMINISTRATOR.DS.'classes'.DS.'admin.class.php');

class lrViewPerson extends JView
{
	function display($tpl = null)
	{
	global $option;

	$pane		= & JPane::getInstance('tabs');
	$document 	= & JFactory::getDocument();
	$c = lrAdmin::config();
	$document->addStyleSheet($this->baseurl.'/components/com_lr/assets/css/'.$c->css_file);
	
	$model = &$this->getModel('person');
	$row = &$model->getData(); // List of player info AND his/her teams
	
	$this->assignRef('settings', lrAdmin::config());
	$this->assignRef('row', $row);
	$this->assignRef('pane', $pane);
	
	
//	$this->backlink = JRoute::_('index.php?option='.$option.'&view=team');

		switch ($row[0]->role){
			case 'Player':
			case '':
				$tpl = 'player';
				break;
			case 'Coach':
				$tpl = 'coach';
				break;
			case 'Staff':
				$tpl = 'staff';
				break;
			default:
				break;
		}

	parent::display($tpl);
	}
}

?>
